package com.stan.core.mapper;

import com.stan.core.vo.SessionDetail;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;

@Mapper
public interface SessionDetailMapper {
    @Insert("<script>" +
            "insert into t_session_detail (session_id,user_id,name,username,sex,city,age," +
            "professional,step_length,visit_length,click_product_ids,click_category_ids," +
            "search_keywords,start_time,end_time) values " +
            "<foreach collection='sessionDetails' item='item' separator=','> " +
            "(#{item.sessionId},#{item.userId},#{item.name},#{item.username},#{item.sex},#{item.city},#{item.age}," +
            "#{item.professional},#{item.stepLength},#{item.visitLength},#{item.clickProductIds},#{item.clickCategoryIds}," +
            "#{item.searchKeywords},#{item.startTime},#{item.endTime})" +
            "</foreach>" +
            "</script>")
    void insertList(@Param(value = "sessionDetails") List<SessionDetail> sessionDetails);

}
